package projectsys.sys.core.web.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import projectsys.sys.core.model.User;
import projectsys.sys.core.service.UserManager;

@Controller
@RequestMapping("/user")
public class UserController extends BaseController{
	
	@Autowired
	UserManager userManager;
	
	@RequestMapping("/userShow")
	public ModelAndView toIndex(HttpServletRequest request) {
		Map<String, String> map = super.getParamValues(request);
		ModelAndView mav = new ModelAndView("/showUser");
		User user = userManager.getUserByidInfo(request.getParameter("id"));
		mav.addObject("user", user);
		mav.addObject("map", map);
		return mav;
	}
}
